package com.baiiu.filter;


import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

public class ClassifyBo  implements BaseEntity,Parcelable{


    /**
     * id : 1
     * icon : https://test13641465253.oss-cn-shenzhen.aliyuncs.com/list_button_chuanghyezhe.png
     * classify : 职场发展
     * classifyTwo : [{"id":3,"icon":"https://test13641465253.oss-cn-shenzhen.aliyuncs.com/list_button_jiaoyu.png","classify":"职业规划","pushcategory":"0","pid":1,"type":"2"},{"id":4,"icon":"https://test13641465253.oss-cn-shenzhen.aliyuncs.com/list_button_shenghuo.png","classify":"求职","pushcategory":"0","pid":1,"type":"2"}]
     * type : 1
     */

    private String id;
    private String classifyId;
    private String icon;
    private String classify;
    private String type;
    private boolean isChecked;

    public boolean isChecked() {
        return isChecked;
    }

    public void setChecked(boolean checked) {
        isChecked = checked;
    }

    private int pageNow;
    private int pageSize;
    private List<ClassifyBo> classifyTwo;

    public int getPageNow() {
        return pageNow;
    }

    public void setPageNow(int pageNow) {
        this.pageNow = pageNow;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public ClassifyBo(String id, String classify) {
        this.id = id;
        this.classify = classify;
    }

    protected ClassifyBo(Parcel in) {
        id = in.readString();
        icon = in.readString();
        classify = in.readString();
        type = in.readString();
        classifyTwo = in.createTypedArrayList(ClassifyBo.CREATOR);
    }

    public static final Creator<ClassifyBo> CREATOR = new Creator<ClassifyBo>() {
        @Override
        public ClassifyBo createFromParcel(Parcel in) {
            return new ClassifyBo(in);
        }

        @Override
        public ClassifyBo[] newArray(int size) {
            return new ClassifyBo[size];
        }
    };

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public String getClassify() {
        return classify;
    }

    public void setClassify(String classify) {
        this.classify = classify;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public List<ClassifyBo> getClassifyTwo() {
        return classifyTwo;
    }

    public void setClassifyTwo(List<ClassifyBo> classifyTwo) {
        this.classifyTwo = classifyTwo;
    }

    public ClassifyBo() {
    }

    @Override
    public String toString() {
        return "ClassifyBo{" +
                "id=" + id +
                ", classify='" + classify + '\'' +
                '}';
    }

    public boolean equals(Object obj) {
        if (obj instanceof ClassifyBo) {
            ClassifyBo user = (ClassifyBo) obj;
            return (classify.equals(user.classify)) && (id == id);
        }
        return super.equals(obj);
    }

    public int hashCode() {
        return classify.hashCode();
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeString(id);
        parcel.writeString(icon);
        parcel.writeString(classify);
        parcel.writeString(type);
        parcel.writeTypedList(classifyTwo);
    }

    public String getClassifyId() {
        return classifyId;
    }

    public void setClassifyId(String classifyId) {
        this.classifyId = classifyId;
    }

    public ClassifyBo(String classifyId) {
        this.classifyId = classifyId;
    }

    public ClassifyBo(String classifyId, int pageNow, int pageSize) {
        this.classifyId = classifyId;
        this.pageNow = pageNow;
        this.pageSize = pageSize;
    }

}